#include <sys/stat.h>
#include <fcntl.h>
#include "lc_tunnel_b_op_Operator.h"
#include "UDP_Packet.hh"
#include "TCP_Packet.hh"
#include <iomanip>
#define BUF_SIZE 1500

pktTypes::Packet *
tunnel_b_op::gendata_inRequest()
{
  pktTypes::Packet * pkt = new pktTypes::Packet(new char[BUF_SIZE], BUF_SIZE);
  return pkt;
}

void 
tunnel_b_op::handleMyPort(pktTypes::Packet * data, unsigned long dataSize)
{
  assert(data != NULL);


  pktTypes::Eth_Packet eth(*data);

  pktTypes::ethAddr ea;

  //00:15:17:62:9D:7F

  ea.data[5] = 0x7F;
  ea.data[4] = 0x9D;
  ea.data[3] = 0x62;
  ea.data[2] = 0x17;
  ea.data[1] = 0x15;
  ea.data[0] = 0x00;

  eth.setSrcAddress(ea);

  //00:04:23:BD:5B:F1

  ea.data[5] = 0x3B;
  ea.data[4] = 0x55;
  ea.data[3] = 0x63;
  ea.data[2] = 0x17;
  ea.data[1] = 0x15;
  ea.data[0] = 0x00;

  eth.setDstAddress(ea);

  // set IP Protocol appropriately
  
  eth.setEthProt(ETH_P_IPV6);

  data_out(data, dataSize);
  return;
}


